# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=shorewall
pkgver=5.2.8

_maj_min_patch=$pkgver
case $pkgver in
	*.*.*.*) _maj_min_patch=${pkgver%.*};;
esac
_maj_min=${_maj_min_patch%.*}

pkgrel=1
pkgdesc="An iptables front end for firewall configuration"
url="https://shorewall.org/"
arch="noarch"
license="GPL-2.0-or-later"
options="!check" # No test suite
depends="shorewall-core perl iptables iproute2"
# coreutils for install -T
makedepends="coreutils bash"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://shorewall.org/pub/shorewall/$_maj_min/shorewall-$_maj_min_patch/shorewall-$pkgver.tar.bz2
	shorewall.initd
	shorewallrc.alpine
	shorewall-find.patch
	"
prepare() {
	default_prepare

	cp "$srcdir"/shorewallrc.alpine .
}

build() {
	./configure
}

package() {
	DESTDIR="$pkgdir" ./install.sh shorewallrc.alpine
	install -Dm755 "$srcdir"/shorewall.initd "$pkgdir"/etc/init.d/shorewall
}

sha512sums="
d5fc562f59e97cb462c6c0d7cf2b0f6211d413c2e3db72d93e8ad4f23cd1d0f69c90fff602d6891bbee1725c2505a72f3677c3050758e36f38f0248e8c6c7e52  shorewall-5.2.8.tar.bz2
7e226f42f74ce92d4c40bd0e812fbe744f0e343de7d7d68f59328b57829b0a10e2226fa9ef78e3465846bb2f691f761810774672b0a8510f96b80d7645982dc5  shorewall.initd
c076ae42e7b404cecf521fdc32f92ba3a6b77d61579726abde2f00b6b6282e55b0b334b9fe5e43a6e4ae56361cce3214d9a38099f9f8714f03ae4fb888c744b7  shorewallrc.alpine
101403794e9ac4947702de9303e8364c74a2ffba007310b6a6dc8a99388cd2d152fa74e145c2dab9e71518a01fe0ebfb4c6a6bb0fa8225329416ebc0ad917b87  shorewall-find.patch
"
